package org.finesys.codegen.conveter;

import io.swagger.v3.oas.annotations.media.Schema;
import org.finesys.codegen.dto.GenTemplateGroupDTO;
import org.finesys.codegen.entity.GenGroup;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Schema(title = "分组模版转换对象")
@Mapper
public interface GenGroupConvert {
    GenGroupConvert INSTANCE = Mappers.getMapper(GenGroupConvert.class);

    /**
     * 转换
     */
    GenGroup convert(GenTemplateGroupDTO genTemplateGroupDTO);

    /**
     * 转换
     */
    @Mappings({
            @Mapping(target = "templateIds", ignore = true)
    })
    GenTemplateGroupDTO convert(GenGroup genGroup);
}
